var ScaleScreen = function () {

	var w, h, _w, _h, scale, $self, $win = $(window);

	var initscreen = function () {

		$self.css({
		    'position': 'relative',
			'transform': 'scale(' + scale + ')',
			'margin-top': (h - _h * scale) / 2 + 'px',
			'margin-left': (w - _w * scale) / 2 + 'px',
		    'transform-origin': 'left top 0'
		});
	};

	var initdata = function () {
		
		$('html, body').css({
			'width': '100%',
			'height': '100%',
			'overflow': 'hidden'
		})

		w = $win.innerWidth();
		h = $win.innerHeight();

		_w = $self.innerWidth();
		_h = $self.innerHeight();

		scale = (w / h == _w / _h) ? 1 : ((w / h < _w / _h) ? (w / _w) : (h / _h));

		initscreen();

	};

	return {

		init: function (self) {
			$self = $(self);
			console.log($self);
			initdata();
			$win.on('resize', initdata);

		}

	}

}();